/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.vehiculo.Entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Daniel
 */
@Entity
@Table(catalog = "", schema = "APP")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Trabajador.findAll", query = "SELECT t FROM Trabajador t"),
    @NamedQuery(name = "Trabajador.findByIdVehiculo", query = "SELECT t FROM Trabajador t WHERE t.id_Vehiculo = :id_Vehiculo"),
    @NamedQuery(name = "Trabajador.findByCambio_Aceite", query = "SELECT t FROM Trabajador t WHERE t.cambio_aceite = :cambio_aceite"),
    @NamedQuery(name = "Trabajador.findByMarca", query = "SELECT t FROM Trabajador t WHERE t.marca = :marca")
    })
public class Vehiculo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 8)
    @Column(name = "ID_VEHICULO", nullable = false, length = 8)
    private String id_Vehiculo;
    @Size(max = 50)
    @Column(length = 50)
    private String cambio_aceite;
    @Size(max = 50)
    @Column(length = 50)
    private String marca;
    
    @ManyToOne
    @JoinColumn(name ="id_Cambio_Aceite",referencedColumnName ="id_Cambio_Aceite" )
    private Cambio_Aceite cambio_aceiteActual;
    

    public Vehiculo() {
    }

    public Vehiculo(String id_Vehiculo) {
        this.id_Vehiculo = id_Vehiculo;
    }

    public String getIdVehiculo() {
        return id_Vehiculo;
    }

    public void setIdVehiculo(String id_Vehiculo) {
        this.id_Vehiculo = id_Vehiculo;
    }

    public String getCambio_Aceite() {
        return cambio_aceite;
    }

    public void setCambio_Aceite(String cambio_aceite) {
        this.cambio_aceite = cambio_aceite;
    }

    public String getMarca() {
        return marca;
    }

    public void setMarca(String marca) {
        this.marca = marca;
    }

    public Cambio_Aceite getCambio_AceiteActual() {
        return cambio_aceiteActual;
    }

    public void setCambio_AceiteActual(Cambio_Aceite cambio_aceiteActual) {
        this.cambio_aceiteActual = cambio_aceiteActual;
    }
    
    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id_Vehiculo != null ? id_Vehiculo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Vehiculo)) {
            return false;
        }
        Vehiculo other = (Vehiculo) object;
        if ((this.id_Vehiculo == null && other.id_Vehiculo != null) || (this.id_Vehiculo != null && !this.id_Vehiculo.equals(other.id_Vehiculo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.vehiculo.Entity.Vehiculo[ id_Vehiculo=" + id_Vehiculo + " ]";
    }
    
}
